package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.*;

import java.util.List;  
  
@Mapper  
public interface NursingProjectMapper {  
  
    // 插入操作  
    @Insert("INSERT INTO nursing_project (name, order_no, unit, price, image, nursing_requirement, status, create_by, create_time, update_time) " +
            "VALUES (#{name}, #{orderNo}, #{unit}, #{price}, #{image}, #{nursingRequirement}, #{status}, #{createBy}, #{createTime},#{updateTime})")
    int insertNursingProject(NursingProject nursingProject);
  
    // 查询所有操作  
    @Select("SELECT * FROM nursing_project")  
    List<NursingProject> selectAllNursingProjects();  
  
    // 根据ID查询操作  
    @Select("SELECT * FROM nursing_project WHERE id = #{id}")
    NursingProjectVo selectNursingProjectById(@Param("id") Long id);
  
    // 更新操作  

    int updateNursingProject(NursingProject nursingProject);  
  
    // 删除操作  
    @Delete("DELETE FROM nursing_project WHERE id = #{id}")  
    int deleteNursingProject(@Param("id") Long id);

    // 分页的条件查询
    public Page<NursingProject> selectByPage(@Param("name") String name,@Param("status") Integer status);
}